/**
 * @file
 * @description 首页请求数据
 * **/

import request from './request'

/**
 * @method
 * @description 首页导航
 * **/
export const head = () => request.get('home/category/head')


/**
 *  @description 轮播图数据请求
 *  @method
 */
export const Banner = () => request.get('home/banner');

/**
 * @method
 * @description 获取最新好物
 * **/
export const getNew = () => request.get('home/new')

/**
 * @method
 * @description 获取人气推荐
 * **/
export const getHot = () => request.get('home/hot')

/**
 * @method
 * @description 获取人气品牌
 * @param {limit}  页码
 * **/
 export const getBrand = (limit) => request.get('home/brand',limit)

/**
 * @method
 * @description 获取居家
 * **/
 export const getHomeGoods = () => request.get('home/goods')

 /**
 * @method
 * @description 获取最新专题
 * **/
  export const getSubject = () => request.get('home/special')

  /**
  * @method
  * @description详情页数据渲染
  * @param {model} id 详情id
  * @returns
  */
   export const getImit = () => request.get('/goods/relevant?id=3990288&limit=16')

   /**
  * 
  * @param {object} id  接收详情id 
  * @returns 
  */
   export const getDetails = (id) => request.get(`/goods?id=${id}`)

   /**
    * 三级联动
    */
    export const getRegion = () => request.get('https://yjy-oss-files.oss-cn-zhangjiakou.aliyuncs.com/tuxian/area.json')

  /** 
  * @param {object} id  24小时热销榜
  * @returns 
  */
  export const gethot = (id) => request.get(`/goods/hot?id=${id}&limit=3&type=1`)

  /** 
  * @param {object} id 周热销榜
  * @returns 
  */
  export const getHots = (id) => request.get(`/goods/hot?id=${id}&limit=3&type=2`)